﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using RrslLite.Net.Attributes;
using RrslLite.Net.Messages;

namespace RrslLite.Net.Contracts
{
    [ServiceContract(CallbackContract = typeof(IWcfDuplexMessageClient))]
    public interface IWcfDuplexMessageService
    {
        [OperationContract(IsOneWay=true)]
        [ServiceKnownType("GetKnownTypes", typeof(KnownTypeProvider))]
        void InvokeOperations(params Message[] messages);
    }

    [ServiceContract]
    public interface IWcfDuplexMessageClient
    {
        [OperationContract(IsOneWay = true, AsyncPattern = true)]
        [ServiceKnownType("GetKnownTypes", typeof(KnownTypeProvider))]
        IAsyncResult BeginReceive(Message[] messages, AsyncCallback callback, object state);
        void EndReceive(IAsyncResult result);

        //[OperationContract(IsOneWay = true)]
        //[ServiceKnownType("GetKnownTypes", typeof(KnownTypeProvider))]
        //void Receive(params Message[] messages);
    }
}
